perm filename HF65.TEX[UHF,DEK] blob sn#841746 filedate 1987-06-16 generic text, type T, neo UTF8
% for halftones on the Imagen
\chardef\other=12
\font\halftone=dot300[uhf,dek]

\def\beginhalftone{\vbox\bgroup\offinterlineskip\halftone
 \catcode`\\=\other \catcode`\↑=\other \catcode`\_=\other
 \catcode`\.=\active \starthalftone}
{\catcode`\.=\active \catcode`\|=0 \catcode`\\=\other
 |gdef|starthalftone#1\endhalftone{|let.=|endhalftoneline
  |beginhalftoneline#1|endhalftone}}
\def\beginhalftoneline{\hbox\bgroup\ignorespaces}
\def\endhalftoneline{\egroup\beginhalftoneline}
\def\endhalftone{\egroup\setbox0=\lastbox\unskip\egroup}

% Example of use:
% \beginhalftone
% chars for top line of picture.
% chars for second line of picture.
% ...
% chars for bottom line of picture.
% \endhalftone

% character "0" is white, and character "p" is black;
% the dot font uses 65 consecutive ASCII codes for levels 0 to 64,
% where level k is a character with k bits black in an 8x8 square array.

% (the physics of the printer causes a nonlinear response to these levels)